package com.fishery.monitor.dao;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fishery.monitor.mapper.MonitorBaseMapper;
import com.fishery.monitor.pojo.MonitorBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
@Component
public class BaseDao {

    @Autowired
    MonitorBaseMapper monitorBaseMapper;




    public IPage<MonitorBase> findAll(Page<MonitorBase> monitorBasePage, QueryWrapper<MonitorBase> wrapper) {
        return  monitorBaseMapper.selectPage(monitorBasePage,wrapper);
    }

    public List<MonitorBase> findAll(QueryWrapper<MonitorBase> wrapper) {
        return monitorBaseMapper.selectList(wrapper);
    }

    public MonitorBase findById(String id) {
        return monitorBaseMapper.selectById(id);
    }

    public void update(MonitorBase base) {
        this.monitorBaseMapper.updateById(base);
    }
}
